package itheima_Integer;

public class Integer02 {
    public static void main(String[] args) {
        /*

               Integer i = Integer.valueOf(100);
        Integer i2 = Integer.valueOf("100");

        //装箱
        Integer a = 100;
        //拆箱

        int b = a;
        int  a1 = a.intValue();

        //integer使用前最好进行一次非空判断(为空的数据类型不重新赋值)
        Integer i4 = null;

        //String转int
        String res = "100";
        int i1 = Integer.parseInt(res);
        //int转String
        int i3 = 100;
        String num = String.valueOf(i3);
        */

        //字符串和
        String d = "92 12 24 32 15 23 33 21 11";

        int num = 0;
        String[] arrayB = d.split(" ");
        for (int i = 0; i < arrayB.length; i++) {
            String a = arrayB[i];

             num += Integer.valueOf(a);
        }
             System.out.println(num);
    }
}
